package main

import (
	"encoding/json"
	"fmt"
	"io/ioutil"
	"log"
)

func handleOt(filePath string) {

	if filePath == "" {
		filePath = "template.json"
	}

	configList := ConfigList{
		List: []Config{
			{},
		},
	}
	configList = formatConfig(configList)
	jsonByte, err := json.MarshalIndent(configList, "", "	")
	if err != nil {
		log.Panic(err)
	}
	err = ioutil.WriteFile(filePath, jsonByte, 0777)
	if err != nil {
		fmt.Println(err)
	}
	fmt.Println("write file successful")
}
